import { IPSAppDEField } from '../../app/dataentity/ipsapp-defield';
import { IPSDEChart } from './ipsdechart';
import { IPSDEChartLegend } from './ipsdechart-legend';
import { IPSDEChartSeries } from './ipsdechart-series';
import { IPSDEChartTitle } from './ipsdechart-title';
import { PSChartImpl } from './pschart-impl';
import { IPSLanguageRes } from '../../res/ipslanguage-res';

export class PSDEChartImpl extends PSChartImpl implements IPSDEChart {
  get baseOptionJOString(): string {
    return this.M.baseOptionJOString;
  }

  get codeName(): string {
    return this.M.codeName;
  }

  get coordinateSystem(): 'XY' | 'POLAR' | 'RADAR' | 'PARALLEL' | 'SINGLE' | 'CALENDAR' | 'MAP' | 'NONE' {
    return this.M.coordinateSystem;
  }

  get emptyText(): string {
    return this.M.emptyText;
  }

  protected emptytextpslanguageres: IPSLanguageRes | null = null;

  getEmptyTextPSLanguageRes(): IPSLanguageRes | null {
    if (this.emptytextpslanguageres != null) return this.emptytextpslanguageres;
    const value = this.M.getEmptyTextPSLanguageRes;
    if (value == null) {
      return null;
    }
    this.emptytextpslanguageres = this.getPSModel4('res.IPSLanguageRes', value, 'getEmptyTextPSLanguageRes') as IPSLanguageRes;
    return this.emptytextpslanguageres;
  }

  get emptyTextPSLanguageRes(): IPSLanguageRes | null {
    return this.getEmptyTextPSLanguageRes();
  }

  getEmptyTextPSLanguageResMust(): IPSLanguageRes {
    const value = this.getEmptyTextPSLanguageRes();
    if (value == null) {
      throw new Error('未指定无值内容语言资源');
    }
    return value;
  }

  get minorSortDir(): 'ASC' | 'DESC' {
    return this.M.minorSortDir;
  }

  protected minorsortpsappdefield: IPSAppDEField | null = null;

  getMinorSortPSAppDEField(): IPSAppDEField | null {
    if (this.minorsortpsappdefield != null) return this.minorsortpsappdefield;
    const value = this.M.getMinorSortPSAppDEField;
    if (value == null) {
      return null;
    }
    this.minorsortpsappdefield = this.getPSModel4('app.dataentity.IPSAppDEField', value, 'getMinorSortPSAppDEField') as IPSAppDEField;
    return this.minorsortpsappdefield;
  }

  get minorSortPSAppDEField(): IPSAppDEField | null {
    return this.getMinorSortPSAppDEField();
  }

  getMinorSortPSAppDEFieldMust(): IPSAppDEField {
    const value = this.getMinorSortPSAppDEField();
    if (value == null) {
      throw new Error('未指定默认排序应用实体属性');
    }
    return value;
  }

  protected psdechartlegend: IPSDEChartLegend | null = null;

  getPSDEChartLegend(): IPSDEChartLegend | null {
    if (this.psdechartlegend != null) return this.psdechartlegend;
    const value = this.M.getPSDEChartLegend;
    if (value == null) {
      return null;
    }
    this.psdechartlegend = this.getPSModel4('control.chart.IPSDEChartLegend', value, 'getPSDEChartLegend') as IPSDEChartLegend;
    return this.psdechartlegend;
  }

  get psDEChartLegend(): IPSDEChartLegend | null {
    return this.getPSDEChartLegend();
  }

  getPSDEChartLegendMust(): IPSDEChartLegend {
    const value = this.getPSDEChartLegend();
    if (value == null) {
      throw new Error('未指定实体图表图例对象');
    }
    return value;
  }

  protected psdechartserieses: IPSDEChartSeries[] | null = null;

  getPSDEChartSerieses(): IPSDEChartSeries[] | null {
    if (this.psdechartserieses == null) {
      this.psdechartserieses = this.fillChildListModel(this.M.getPSDEChartSerieses, 'control.chart.IPSDEChartSeries') as IPSDEChartSeries[];
    }
    return this.psdechartserieses;
  }

  get psDEChartSerieses(): IPSDEChartSeries[] | null {
    return this.getPSDEChartSerieses();
  }

  findPSDEChartSeries(objKey: any): IPSDEChartSeries | null {
    return this.getPSModel5('control.chart.IPSDEChartSeries', this.getPSDEChartSerieses(), objKey) as IPSDEChartSeries;
  }

  protected psdecharttitle: IPSDEChartTitle | null = null;

  getPSDEChartTitle(): IPSDEChartTitle | null {
    if (this.psdecharttitle != null) return this.psdecharttitle;
    const value = this.M.getPSDEChartTitle;
    if (value == null) {
      return null;
    }
    this.psdecharttitle = this.getPSModel4('control.chart.IPSDEChartTitle', value, 'getPSDEChartTitle') as IPSDEChartTitle;
    return this.psdecharttitle;
  }

  get psDEChartTitle(): IPSDEChartTitle | null {
    return this.getPSDEChartTitle();
  }

  getPSDEChartTitleMust(): IPSDEChartTitle {
    const value = this.getPSDEChartTitle();
    if (value == null) {
      throw new Error('未指定实体图表标题对象');
    }
    return value;
  }

  get hasWFDataItems(): boolean {
    return this.M.hasWFDataItems;
  }

  getHasWFDataItems(): boolean {
    return this.M.hasWFDataItems;
  }

  get cls(): string {
    return 'PSDEChartImpl';
  }

  instanceof(cls: string): boolean {
    if (cls == 'control.chart.IPSDEChart' || cls == 'control.chart.IPSECharts') return true;
    return super.instanceof(cls);
  }
}
